package com.briup.ptt.web.controller;

import com.briup.ptt.service.AnalysisService;
import com.briup.ptt.util.Result;
import com.briup.ptt.util.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


/**
 * @author 杰瑞
 * @date 2025/8/14
 */
@Api(tags = "首页大屏模块")
@RestController
@RequestMapping("/analysis")
public class AnalysisController {
    @Resource
    private AnalysisService analysisService;

    @ApiOperation("统计数量")
    @GetMapping("/count")
    public Result countNum(){
        return ResultUtil.success(analysisService.countNum());
    }

    @ApiOperation("统计重量")
    @GetMapping("indexCount")
    public Result countWeight(){
        return ResultUtil.success(analysisService.countWeight());
    }

    @ApiOperation("统计疾病")
    @GetMapping("/countDisease")
    public Result countDisease(){
        return ResultUtil.success(analysisService.countDisease());
    }

    @ApiOperation("统计销售")
    @GetMapping("countSales")
    public Result countSales(){
        return ResultUtil.success(analysisService.countSales());
    }


}
